package com.xin;


// 简单工厂模式
public class App {

    public static void main(String[] args) {

        OperationFactory factory = new OperationFactory();
        String ope = "+";

        // 通过简单工厂模式得到运算类实例
        Operation operation = factory.createOpetation(ope);
        operation.setNumbera(1);
        operation.setNumberb(4);


        int result = operation.getResult();
        System.out.println("result: " + result);

    }
}
